from pydantic import BaseModel
from typing import List, Optional


class BaseResponse(BaseModel):
    code: int
    msg: str


class LoginRequest(BaseModel):
    """
    请求模型验证：
    name:
    password:
    """
    name: str
    password: str


class SimpleCartItem(BaseModel):
    goodsId: int
    quantity: int


class CreateOrderRequest(BaseModel):
    simpleCartItemList: List[SimpleCartItem]


class Token(BaseModel):
    token: str


class LoginResp(BaseResponse):
    data: Token = None

